<?php
class ModelCatalogPages extends Model {
	public function getInformation($pages_id) {
		$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "pages i LEFT JOIN " . DB_PREFIX . "pages_description id ON (i.pages_id = id.pages_id) LEFT JOIN " . DB_PREFIX . "pages_to_store i2s ON (i.pages_id = i2s.pages_id) WHERE i.pages_id = '" . (int)$pages_id . "' AND id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1'");
	
		return $query->row;
	}
	
	public function getInformations() {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "pages i LEFT JOIN " . DB_PREFIX . "pages_description id ON (i.pages_id = id.pages_id) LEFT JOIN " . DB_PREFIX . "pages_to_store i2s ON (i.pages_id = i2s.pages_id) WHERE id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1' AND i.sort_order <> '-1' ORDER BY i.sort_order, LCASE(id.title) ASC");
		
		return $query->rows;
	}
}
?>